package com.rundow.common.sdk.handler;

import com.rundow.common.sdk.service.DriverCustomService;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * 静态代理
 */
public class DriverCustomInvocationHandler implements InvocationHandler {
    private DriverCustomService driverCustomService;

    public DriverCustomInvocationHandler(DriverCustomService service) {
        this.driverCustomService = service;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object invoke = method.invoke(driverCustomService, args);//拦截对象
        return invoke;
    }
}
